package cn.cdeden.knowledge.controller.docLog;

import cn.cdeden.common.core.domain.R;
import cn.cdeden.common.core.utils.page.TableDataInfo;
import cn.cdeden.knowledge.domain.dto.SysDocLogDto;
import cn.cdeden.knowledge.domain.dto.SysDocLogQueryParam;
import cn.cdeden.knowledge.service.SysDocLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @author GW
* @date 2024-01-19
**/
@RestController
@RequiredArgsConstructor
//@Api(tags = "文档操作日志管理")
@RequestMapping("/api/sysDocLog")
public class SysDocLogController {

    private final SysDocLogService sysDocLogService;

//    @Log("查询文档操作日志")
//    @ApiOperation("查询文档操作日志")
    @GetMapping(value = "query")
    public R<TableDataInfo<SysDocLogDto>> query(SysDocLogQueryParam query, Pageable pageable){
        TableDataInfo<SysDocLogDto> info = sysDocLogService.queryAll(query,pageable);
        return R.ok(info);
    }

////    @Log("新增文档操作日志")
////    @ApiOperation("新增文档操作日志")
//    @PostMapping(value = "add")
//    public BaseRespResult create(@Validated @RequestBody SysDocLogDto resources){
//        return BaseRespResult.successResult(sysDocLogService.insert(resources));
//    }

////    @Log("修改文档操作日志")
////    @ApiOperation("修改文档操作日志")
//    @PostMapping(value = "update")
//    public BaseRespResult update(@Validated @RequestBody SysDocLogDto resources){
//        return BaseRespResult.successResult(sysDocLogService.updateById(resources));
//    }
//
////    @Log("删除文档操作日志")
////    @ApiOperation("删除文档操作日志")
//    @GetMapping(value = "delete")
//    public BaseRespResult delete(@RequestBody(required = false) Set<Long> ids) {
//        return BaseRespResult.successResult(sysDocLogService.deleteByIds(ids));
//    }

    /*
//    @Log("导出文档操作日志")
//    @ApiOperation("导出文档操作日志")
    @GetMapping(value = "/download")
    @PreAuthorize("@el.check('sysEnterpriseLog:list')")
    public void download(HttpServletResponse response, SysEnterpriseLogQueryParam query) throws IOException {
        sysEnterpriseLogService.download(sysEnterpriseLogService.queryAll(query), response);
    }*/

}
